package com.martini.satoken01.model.mapper.impl;

import com.martini.satoken01.entity.SysUser;
import com.martini.satoken01.model.dto.UserRegInfoDTO;
import com.martini.satoken01.model.mapper.SysUserEntityMapper;
import com.martini.satoken01.model.vo.SysUserVO;
import org.springframework.beans.BeanUtils;

/**
 * @author martini at 2021/12/19 10:29
 */
public class BeanUtilsSysUserEntityMapperImpl implements SysUserEntityMapper {

    @Override
    public SysUser toSysUser(UserRegInfoDTO userRegInfoDTO) {
        SysUser sysUser = new SysUser();
        BeanUtils.copyProperties(userRegInfoDTO, sysUser);
        return sysUser;
    }

    @Override
    public SysUserVO toSysUserVO(SysUser sysUser) {
        SysUserVO sysUserVO = new SysUserVO();
        BeanUtils.copyProperties(sysUser, sysUserVO);
        return sysUserVO;
    }

}
